Skip to content

Facebook v2 working modules for facebook posts/threads and comments - #95

Open
uree wants to merge 55 commits into
digitalmethodsinitiative:facebook-v2from
uree:facebook-v2
Open

Facebook v2 working modules for facebook posts/threads and comments#95
uree wants to merge 55 commits into
digitalmethodsinitiative:facebook-v2from
uree:facebook-v2

Conversation

@uree

@uree uree commented Aug 18, 2026

Copy link
Copy Markdown

This is a version with active Facebook modules, which we've used for a research project.

I made minimal changes just to get the downloading of posts and comments to run. The data processing, which there is a lot of, is externalized to a Python package called zeextractor. So the workflow is: download huge FB ndjson blobs > extract useful info from them using zeextractor > analyse.

I am submitting this PR to document the existence of working FB code and also so we can discuss what to do with it, if anything, under these conditions. The options:

  1. Do nothing, people can just use my fork if they need to. If they find it. Can leave this PR here so it points there.
  2. You approve this PR and we merge into this dusty facebook-v2 branch, add a link to zeextractor in README. Can rebase.
  3. Work on bringing it up to speed and merging it into master, either by
    • linking to zeextractor and adding a disclaimer that extra data processing is required for FB;
    • porting the data processing from Python to zeeschuimer;
    • i spin up an API for zeextractor so calls can be made from zeeschuimer.

Let me know what you think.

dale-wahl and others added 30 commits November 22, 2024 13:46
…ing one video); collect individual videos from /video/ links
overhauled embed extraction and allow multiple embedded objects to be parsed
Instead of exact match: allows Pinterest module to work for e.g. 'nl.pinterest.com'
@stijn-uva

Copy link
Copy Markdown
Member

Hi @uree , this looks very cool! As we discussed a while ago Facebook support is a popular feature request so we would be very happy to merge this. With some quick testing, it seems to work well for posts, though not all comments I'm seeing seem to be captured.

But in any case I think we would be eager to go for Option 3. The challenge being the mapping code (i.e. how to get something useful out of the ndjsons). Looks like you did most of the heavy lifting there too as well, which is very nice.

We recently made some changes to Zeeschuimer to add CSV download functionality to the extension itself (see #77 and #79). So ideally zeextractor's code would be integrated directly and then people would be able to download Facebook CSVs from the extension itself.

The challenge being that zeextractor is Python and Zeeschuimer is JavaScript. But this actually fits our workflow perfectly - all the mapping code is in fact part of 4CAT (which is written in Python), and we semi-automatically translate it to JavaScript for the CSV download feature. This has worked well for the other platforms' modules and having taken a quick look at zeextractor's code I think it should be possible for that as well.

But it would require the mapping code to be in 4CAT directly rather than in an external dependency (see TikTok's mapper function for an example). So I suppose the question is what you think about that. I don't know for example how you use zeextractor in your workflow and how important it is for it to be a standalone app/library. Alternatively, there could be separate codebases (zeextractor and 4CAT).

@uree

uree commented Aug 20, 2026

Copy link
Copy Markdown
Author

Very good. zeextractor was written purely for the purpose of processing Zeeschuimer data and it does not seem like it will have a life of its own beyond that, so we can strip it for parts and integrate it with 4CAT. I suppose there would also be a bit less friction when it comes to maintenance if it's all in the same repo?

On the other hand, the quickest path to implementation I see involves using zeextractor as a package. I could quickly take this pipeline out of the loop and into a separate function which returns a dict and we can just install it and call that from SearchFacebook map_item, I assume?

I wrote the mapping based on what we thought was useful for our purposes, but there might be more useful data points in there. That, however, is a can which can safely be kicked down the road, I feel.

About the comments ... Unfortunately, to save all the comments under a post (not just the ones which are visible), you have to click on the comment thread while you scroll. Hovering over the "show more comments" link also worked at some point. It's a legit question whether this is good enough for inclusion (and just add a disclaimer), or should the comment gathering functionality be left out of Zeeschuimer for now. Until someone figures out a way to trigger these "fetch comments" events programmatically, for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants